/**
 * Created by Administrator on 2017/6/26 0026.
 */
var express = require('express');
var indexsModel = require('../models/candy');
var router = express.Router();
/* GET users listing. */
router.get('/', function(req, res, next) {
    res.send('这里是详情页面')
});
router.get('/shuju', function(req, res) {
    indexsModel.getindexsList(function (List) {
        console.log(List);
        res.status(200).json(List);
    })
});
router.get('/xiangqing', function(req, res) {
    //var id=req.params.id;
    //console.log(req.params.id)

    //indexsModel.findById(id,function(err,detail){
    //    res.render('detail_xiangqing',{detail:detail});
    //})
    res.render('detail_xiangqing')
});
router.get('/shoucang', function(req, res) {
    res.render('detail_shoucang');
});
router.get('/pinglun', function(req, res) {
    res.render('detail_pinglun');
});
router.get('/detail', function(req, res) {
    //var  type = req.query.type;
    //var  id = req.query.id;
    //switch(type){
    //    case "indexs":
    //
    //        res.render('detail',{id:id});break;
    //    case "senyongs":
    //        indexsModel.getsenyongsInfo({id:id},function (LIST) {
    //            console.log(LIST);
    //            res.render('detail',{LIST:LIST})
    //        });break;
    //    case "koufulais":
    //        indexsModel.getkoufulaisInfo({id:id},function (LIST) {
    //            console.log(LIST);
    //            res.render('detail',{LIST:LIST})
    //        });break;
    //    case "youmans":
    //        indexsModel.getyoumansInfo({id:id},function (LIST) {
    //            console.log(LIST);
    //            res.render('detail',{LIST:LIST})
    //        });break;
    //}

    res.render('detail')
});
module.exports = router;
